<template>
<div class="liveCodeDownloadBox">
  <img class="codeImg" :src="$props.codeUrl">
  <p class="liveCodeDownloadLabel">活码链接：<span>{{ $props.url }}</span><i class="el-icon-copy-document copyIcon" @click="copy"></i></p>
</div>
</template>

<script>
import { copySome } from '../../../utils/utils'
import { ElMessage } from 'element-plus'

export default {
  props:['codeUrl','url'],
  name: 'liveCodeDownloadCode',
  setup(props){
    const copy = () => {
      copySome(props.url,()=>{
        ElMessage.success('复制成功')
      })
    }

    return{
      copy
    }
  }
}
</script>

<style lang="less" scoped>
.liveCodeDownloadBox{
  text-align: center;
  .codeImg{
    width: 120px;
    height: 120px;
  }
  .liveCodeDownloadLabel{
    margin: 20px 0;
    .copyIcon{
      margin-left: 15px;
      font-size: 16px;
      vertical-align: middle;
      cursor: pointer;
    }
  }
}

</style>
